package com.example.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * 座位查询响应DTO
 * 
 * @author HP
 * @description 用于返回座位信息的数据传输对象
 * @createDate 2025-08-26 19:39:00
 */
@Data
@Schema(description = "座位查询响应")
public class SeatQueryResponseDTO {

    @Schema(description = "座位ID", example = "1")
    private Long id;

    @Schema(description = "座位编号", example = "A001")
    private String number;

    @Schema(description = "所属自习室ID", example = "1")
    private Long studyRoomId;

    @Schema(description = "自习室名称", example = "自习室101")
    private String roomName;

    @Schema(description = "座位状态", example = "1")
    private Integer seatStatus;

    @Schema(description = "座位状态描述", example = "有空闲")
    private String seatStatusDesc;

    @Schema(description = "是否可预约", example = "true")
    private Boolean canReserve;

    @Schema(description = "当前预约用户", example = "张三")
    private String currentUser;

    @Schema(description = "当前预约开始时间", example = "2025-08-26 09:00:00")
    private String currentReservationStart;

    @Schema(description = "当前预约结束时间", example = "2025-08-26 18:00:00")
    private String currentReservationEnd;

    /**
     * 获取座位状态描述
     */
    public String getSeatStatusDesc() {
        if (seatStatus == null) {
            return "未知状态";
        }
        switch (seatStatus) {
            case 0:
                return "无预约";
            case 1:
                return "有空闲";
            case 2:
                return "已约满";
            case 3:
                return "维护中";
            default:
                return "未知状态";
        }
    }
}